﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.ServiceModel.Description;
using System.Text;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Client;
using Microsoft.Xrm.Sdk.Discovery;
using XrmLibrary.Adapters;
using XrmLibrary.Connections;
using XrmLibrary.ConfigFile;

namespace XrmLibrary.Configurations
{
    public abstract class CrmConfigurationBase
    {
        protected AdapterConfiguration AdapterConfiguration;

        public void Instantiate(AdapterConfiguration adapterConfiguration)
        {
            AdapterConfiguration = adapterConfiguration;
        }

        public abstract void Load();
        public abstract String GetConfigurationName();
        public abstract Boolean IsCrmDiscoveryServiceConfigured { get; protected set; }
        public abstract IOrganizationServiceAdapter CreateOrganizationServiceAdapter();
        public abstract IDiscoveryServiceAdapter CreateDiscoveryServiceAdapter();
        public abstract void Reinitialize(ClientCredentials credentials);
    }
}
